/**
 * 
 */
package com.sip.dbadapter.dao.impl;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import com.sip.dbadapter.dao.domain.ApiDefinition;
import com.sip.dbadapter.dao.domain.ScenarioRecord;
import com.sip.dbadapter.dao.interfaces.RecordAndPlaySearchDataDao;

/**
 * @author mg40327
 * @param <T>
 *
 */
public class RecordAndPlaySearchDataDaoImpl extends BusinessDaoImpl<ScenarioRecord, Serializable> implements RecordAndPlaySearchDataDao {

	

	public List<ScenarioRecord> getSearchResult(long apiId ,String startDateTime,String endDateTime) throws Exception {
		
	  List<ScenarioRecord>  searchResultList= (List<ScenarioRecord>) exec("select  A from " + getDomainClass().getName() + " A where A.apiDefinitionScenarioRecord.apiId='"+apiId+"' and " +"A.recordDate>'"+startDateTime+"' and  A.recordDate<'"+endDateTime+"'");
		// TODO Auto-generated method stub
		return searchResultList;
	}
	public List<ScenarioRecord> getSearchResult(long apiId) throws Exception {
		
		
	  List<ScenarioRecord>  searchResultList= (List<ScenarioRecord>) exec("select  A from " + getDomainClass().getName() + " A where A.apiDefinitionScenarioRecord.apiId='"+apiId+"'");
		// TODO Auto-generated method stub
		return searchResultList;
	}

    public	List<ScenarioRecord> getSearchResult(String startDateTime,String endDateTime)throws Exception {
	
		 
	  List<ScenarioRecord>  searchResultList= (List<ScenarioRecord>) exec("select  A from " + getDomainClass().getName() + " A where  A.recordDate>'"+startDateTime+"' and  A.recordDate<'"+endDateTime+"'");
		// TODO Auto-generated method stub
		return searchResultList;
	}
    public	List<ScenarioRecord> getSearchResult()throws Exception {
    	
    	List<ScenarioRecord>  searchResultList= (List<ScenarioRecord>) exec("select  A from " + getDomainClass().getName() + " A ");
	
		return searchResultList;
	}
    

	protected Class<ScenarioRecord> getDomainClass() {
		// TODO Auto-generated method stub
		return ScenarioRecord.class;
	}


	


}
